<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>时间</title>
</head>
<body>
<script>
    const now = new Date();
    console.log(now);//获取当前时间
    //创建一个指定日期
    const time = new Date(2020,6,15);
    console.log(time);
    //创建一个指定日期和时间
    const time2 = new Date(2021,7,19,20,0)
    console.log(time2);
</script>
</body>
</html>